import java.util.Scanner;

abstract class Student {
    protected String name;
    protected String number;
    protected String sex;
    protected int score[];

    abstract boolean Verify();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int[] getScore() {
        return score;
    }

    public void setScore(int s1, int s2, int s3) {
        if (this.score == null) this.score = new int[3];
        score[0] = s1;
        score[1] = s2;
        score[2] = s3;
    }
}

class Undergraduate extends Student {
    public Undergraduate(String name, String number, String sex) {
        this.name = name;
        this.number = number;
        this.sex = sex;
    }

    @Override
    boolean Verify() {
        int sum = 0;
        for (int i = 0; i < this.score.length; i++) {
            sum += score[i];
        }
        if (sum >= 180) return true;
        return false;
    }
}

class Graduate extends Student {
    public Graduate(String name, String number, String sex) {
        this.name = name;
        this.number = number;
        this.sex = sex;
    }

    @Override
    boolean Verify() {
        int sum = 0;
        for (int i = 0; i < this.score.length; i++) {
            sum += score[i];
        }
        if (sum >= 240) return true;
        return false;
    }
}


public class Test {
    public static void main(String[] args) {
        Graduate graduate1 = new Graduate("研究生张三","001", "男");
        Graduate graduate2 = new Graduate("研究生李四","002", "男");
        Graduate graduate3 = new Graduate("研究生王五","003", "男");
        Undergraduate undergraduate1 = new Undergraduate("本科生张三","004", "男");
        Undergraduate undergraduate2 = new Undergraduate("本科生李四","005", "男");
        Undergraduate undergraduate3 = new Undergraduate("本科生王五","006", "男");

        undergraduate1.setScore(100,20,60);
        undergraduate2.setScore(20,10,20);
        undergraduate3.setScore(60,60,60);

        graduate1.setScore(100,100,100);
        graduate2.setScore(80,80,80);
        graduate3.setScore(60,60,60);

        if (graduate1.Verify()) System.out.println(graduate1.name + "能毕业");
        else System.out.println(graduate1.name + "不能毕业");

        if (graduate2.Verify()) System.out.println(graduate2.name + "能毕业");
        else System.out.println(graduate2.name + "不能毕业");

        if (graduate3.Verify()) System.out.println(graduate3.name + "能毕业");
        else System.out.println(graduate3.name + "不能毕业");



        if (undergraduate1.Verify()) System.out.println(undergraduate1.name + "能毕业");
        else System.out.println(undergraduate1.name + "不能毕业");

        if (undergraduate2.Verify()) System.out.println(undergraduate2.name + "能毕业");
        else System.out.println(undergraduate2.name + "不能毕业");

        if (undergraduate3.Verify()) System.out.println(undergraduate3.name + "能毕业");
        else System.out.println(undergraduate3.name + "不能毕业");
    }
}
